package ru.arriah.servicedesk.bean;

import java.sql.ResultSet;
import java.sql.SQLException;

import ru.arriah.common.bean.GenericBean;

public class MainReportBean extends GenericBean {

   int newTasks;
   int finishedTasks;
   int newRequests;
   int finishedRequests;
   EmployeeBean employee;
      
   public MainReportBean() {     
   }
   
   public MainReportBean(ResultSet resultSet) {
      this.fillFromResultSet(resultSet);
   }
   
   public EmployeeBean getEmployee() {
      return employee;
   }

   public void setEmployee(EmployeeBean employee) {
      this.employee = employee;
   }

   public int getFinishedRequests() {
      return finishedRequests;
   }

   public void setFinishedRequests(int finishedRequests) {
      this.finishedRequests = finishedRequests;
   }

   public int getFinishedTasks() {
      return finishedTasks;
   }

   public void setFinishedTasks(int finishedTasks) {
      this.finishedTasks = finishedTasks;
   }

   public int getNewRequests() {
      return newRequests;
   }

   public void setNewRequests(int newRequests) {
      this.newRequests = newRequests;
   }

   public int getNewTasks() {
      return newTasks;
   }

   public void setNewTasks(int newTasks) {
      this.newTasks = newTasks;
   }

   @Override
   public void fillFromResultSet(ResultSet resultSet) {
      try {
         setEmployee(new EmployeeBean(resultSet));
         setFinishedRequests(resultSet.getInt("finishedrequests"));
         setFinishedTasks(resultSet.getInt("finishedtasks"));
         setNewRequests(resultSet.getInt("newrequests"));
         setNewTasks(resultSet.getInt("newtasks"));
      } catch (SQLException e) {
         // TODO Auto-generated catch block
         e.printStackTrace();
      }
      
   }

   @Override
   public boolean isValid() {
      // TODO Auto-generated method stub
      return false;
   }

}